<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!Doctype html>
<html>
<head>
    <meta content="text/html" charset="utf-8">
    <title>党建</title>
    <meta name="keywords" content="务川,党建"/>
    <meta name="description" content="务川,党建"/>
    <link href="../../static/images/ico/favicon.png" rel="shortcut icon">
    <link rel="stylesheet" type="text/css" href="../../static/css/info.css">
    <script type="text/javascript" src="../../static/js/user/jq181.js"></script>
    <script type="text/javascript" src="../../static/js/user/info.js"></script>

    <%--后台--%>
    <link rel="stylesheet" href="../../sys/resources/css/reset.css" type="text/css" media="screen"/>
    <link rel="stylesheet" href="../../sys/resources/css/style.css" type="text/css" media="screen"/>
    <link rel="stylesheet" href="../../sys/resources/css/invalid.css" type="text/css" media="screen"/>
    <link rel="stylesheet" href="../../sys/resources/css/bootstrap.css" type="text/css" media="screen"/>
    <link rel="stylesheet" href="../../sys/resources/css/bootstrap-datetimepicker.min.css" type="text/css" media="screen"/>
    <link rel="stylesheet" href="../../sys/resources/css/grumble.css">

    <script type="text/javascript" src="../../sys/resources/scripts/jquery.grumble.min.js"></script>
    <script type="text/javascript" src="../../sys/resources/scripts/zhTable.js"></script>
    <script type="text/javascript" src="../../sys/resources/scripts/bootstrap.js"></script>
    <script type="text/javascript" src="../../sys/resources/scripts/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="../../sys/resources/scripts/bootstrap-datetimepicker.zh-CN.js"></script>
    <script charset="utf-8" src="../../sys/resources/scripts/kindeditor-4.1.1/kindeditor-min.js"></script>
    <script charset="utf-8" src="../../sys/resources/scripts/kindeditor-4.1.1/lang/zh_CN.js"></script>

    <script type="text/javascript" src="../../sys/resources/scripts/zhBase.js"></script>
    <script type="text/javascript" src="../../sys/resources/scripts/zhForm.js"></script>
    <script>
        $(function () {

            /**
             * 提交后的响应函数
             * @param data 服务器返回
             */
            function deal(data) {
                alert(data.msg);
            }

            var zf = new zhForm($("#formId"));
            $("#btnid").click(function () {
                var isSuccess = zf.verify();
                if (isSuccess) {
                    zf.submitForm(deal);
                }
            });
        });
    </script>


    <c:if test="${empty sessionScope.sysUser}">
        <script type="text/javascript">
            alert("亲爱的用户，请先登录");
            window.location.href="/loginReg/login.do";
        </script>
    </c:if>
</head>
<body>
<jsp:include page="../../themes/header.jsp"/>
<div id="middle">
    <div class="wrapper">
        <div id="middle-content">
            <div class="article-wrapper">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">我的相关信息</h3>
                    </div>
                    <div class="panel-body">
                        <form action="/info/addData.do" id="formId" name="form" class="form-horizontal"
                              role="form">
                            <%--<div class="row">--%>
                                <%--<div class="col-xs-12">--%>
                                    <%--<div class="form-group">--%>
                                        <%--<label for="name" class="col-sm-3 control-label">选择文件</label>--%>

                                        <%--<div class="col-sm-5">--%>
                                            <%--<input name="url" type="hidden" id="url"/>--%>
                                            <%--<input name="name" type="text" notNull="true" class="form-control" id="name"--%>
                                                   <%--placeholder="原始文件名称"/>--%>
                                        <%--</div>--%>
                                        <%--<div class="col-sm-2">--%>
                                            <%--<button id="fileBtn" type="button" class="btn btn-info btn-sm">选择文件</button>--%>
                                        <%--</div>--%>
                                    <%--</div>--%>
                                <%--</div>--%>
                            <%--</div>--%>

                            <div class="row">
                                <div class="col-xs-12">
                                    <div class="form-group">
                                        <label for="title" class="col-sm-2 control-label">标题</label>

                                        <div class="col-sm-9">
                                            <input name="title" type="text" notNull="true" class="form-control"
                                                   id="title"
                                                   placeholder="标题"/>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-xs-12">
                                    <div class="form-group">
                                        <label for="title" class="col-sm-2 control-label">文件类型</label>

                                        <div class="col-sm-9">
                                            <select class="form-control" name="type" notNull="true">
                                                <option value="" selected></option>
                                                <option value="1">思想动态</option>
                                                <option value="2">提交材料资料</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                            </div>

                                <div class="row">
                                    <div class="col-xs-12">
                                        <div class="form-group">
                                            <label for="title" class="col-sm-2 control-label">简要描述</label>

                                            <div class="col-sm-9">
                                                <input name="description" type="text" notNull="true" class="form-control"
                                                       id="description"
                                                       placeholder="简要描述"/>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                            <div class="row">
                                <div class="col-xs-12">
                                    <div class="form-group">
                                        <label for="title" class="col-sm-2 control-label">文件描述</label>

                                        <div class="col-sm-9">
                                            <textarea id="content" name="content" class="form-control" notNull="true"
                                                      rows="25"></textarea>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-xs-2">
                                </div>
                                <div class="col-xs-2">
                                    <button type="button" id="btnid" class="btn btn-success btn-block">提交</button>
                                </div>
                                <div class="col-xs-2">
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<jsp:include page="../../themes/footer.jsp"/>

<script type="text/javascript">
    var editor;
    KindEditor.ready(function (K) {
        editor = K.create('textarea[name="content"]', {
            resizeType:0,
            allowPreviewEmoticons:false,
            allowUpload:true,
            //是否可以弹出对话框选择文件
            allowFileManager:true,
            //文件选择的时候弹出的对话框/对话框中可以放置服务器图片文件
            allowImageUpload:true,
            uploadJson:"/file/imageUpload.do",
            syncType:"absolute",
            items:['source', '|', 'fullscreen', 'undo', 'redo', 'print', 'cut', 'copy', 'paste',
                'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
                'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
                'superscript', '|', 'selectall', 'title', 'fontname', 'fontsize', '|', 'textcolor',
                'bgcolor', 'bold', 'italic', 'underline', 'strikethrough', 'removeformat', '|'
                , 'advtable', 'hr', 'emoticons', 'image', 'insertfile', 'link', 'unlink'],
            afterCreate:function () {
                var self = this;
                K.ctrl(document, 13, function () {
                    self.sync();
                    document.forms['form'].submit();
                });
                K.ctrl(self.edit.doc, 13, function () {
                    self.sync();
                    document.forms['form'].submit();
                });
            },
            afterBlur:function () {
                this.sync();
            }
        });
    });
</script>
</body>
</html>